<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>用户预约办卡</title>
        <link href="/zhenze/Public/admin/css/style.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="/zhenze/Public/admin/js/jquery.js"></script>
        <script type="text/javascript" src="/zhenze/Public/My97DatePicker/WdatePicker.js"></script> 
        <script type="text/javascript" src="/zhenze/Public/layer/layer.js"></script>

		<link href="/zhenze/Public/admin/css/select.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/zhenze/Public/admin/js/jquery.idTabs.min.js"></script>
		<script type="text/javascript" src="/zhenze/Public/admin/js/select-ui.min.js"></script>

		<script type="text/javascript">
		$(document).ready(function(e) {
			$("#status").uedSelect({
				width : 100			  
			});
			$("#agent").uedSelect({
				width : 150			  
			});
		});
		</script>
        <script type="text/javascript">
            function show(id, title) {
                layer.open({
                    type: 2,
                    title: '详细信息',
                    maxmin: false,
                    shadeClose: true, //点击遮罩关闭层
                    area: ['800px', '520px'],
                    content: '<?php echo U("user/reservedetail");?>&id=' + id
                });
            }
        </script>
    </head>

    <body>

        <div class="place">
            <span>位置：</span>
            <ul class="placeul">
                <li><a href="<?php echo U('index/welcome');?>">首页</a></li>
                <li><a href="###">用户预约办卡</a></li>
            </ul>
        </div>

        <div class="formbody"> 
            <form name="seachform" id="seachform" action="<?php echo U('user/reserve');?>" method="post">
                <ul class="seachform">
                    <li><input style='width:80px;' placeholder="申请用户" name="nickname"  value="<?=I('nickname')?>" type="text" class="scinput" /></li>		
                    <li><input style='width:80px;' placeholder="用户名" name="name"  value="<?=I('name')?>" type="text" class="scinput" /></li>		
                    <li><input style='width:80px;' placeholder="联系电话" name="mobile"  value="<?=I('mobile')?>" type="text" class="scinput" /></li>		
                    <li><input style='width:80px;' placeholder="身份证" name="idcard"  value="<?=I('idcard')?>" type="text" class="scinput" /></li>		
                    <li><input style='width:80px;' placeholder="学校" name="school"  value="<?=I('school')?>" type="text" class="scinput" /></li>
					<li>
					<div class="vocation">
						<select id="status" name="status">
							<option value="">请选择类型</option>
							<?php if(is_array($statusinfo)): $i = 0; $__LIST__ = $statusinfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><option value="<?php echo ($key); ?>" <?php if($key == I('status') ): ?>selected<?php endif; ?>><?php echo ($data); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
						</select>
					</div>
					</li>	
                    <li><label></label><input placeholder="起始时间" name="start_time" id="starttime" class="scinput" type="text" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" datatype="*" errormsg="时间范围开始值不能为空！" maxlength="20" style="width: 100px;" readonly value="<?=I('start_time')?>" /></li>
                    <li><label></label><input placeholder="截止时间" name="end_time" id="endtime" class="scinput" type="text" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" datatype="*" errormsg="时间范围结束值范围不能为空！" maxlength="20" style="width: 100px;" readonly value="<?=I('end_time')?>" /></li>
                    <li><label>&nbsp;</label><input name="" type="submit" class="scbtn" value="查询"/></li>
                </ul>
            </form>

            <form id="listform" name="listform" action="<?=U('user/batchgroup')?>" method="post">
                <table class="tablelist">
                    <thead>
                        <tr> 
                            <th><input type="checkbox" name="checkbox" value="checkbox" id="chkAll" /></th>
                            <th>申请用户</th>
                            <th>用户名</th>
                            <th>联系电话</th>
                            <th>办理套餐卡号</th>
                            <th>身份证</th>
                            <th>申请学校</th>
                            <th>时间</th>
                            <th>代理人</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if(is_array($dataList)): $i = 0; $__LIST__ = $dataList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$value): $mod = ($i % 2 );++$i;?><tr> 
                                <td><input type="checkbox" id="checkbox<?= $value['id'] ?>" name="user_id[]" value="<?= $value['id'] ?>" /></td>
                                <td><?= $value['nickname']?></td>
                                <td><?= $value['name']?></td> 
                                <td><?= $value['mobile']?></td> 
                                <td><?= $value['set_title']?>/<?= $value['new_mobile']?></td> 
                                <td><?= $value['idcard']?></td> 
                                <td><?= $value['school_name']?></td> 
                                <td><?= date('Y-m-d H:i:s',$value['time'])?></td>  
                                <td><?= $value['agent']?></td> 
                                <td><?php echo ($statusinfo[$value['status']]); ?></td> 
                                <td>
                                    <a href="javascript:show(<?= $value['id']?>,'<?= $value['name']?>');" class="tablelink">查看</a>				 
                                </td>
                            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                    </tbody>
                </table>

                <?php echo ($pageshow); ?>

				<ul class="toolbar" style="padding-top:10px;">
					<li>
						<div class="vocation">
						<select id="agent" name="agent" class="dfinput" style="width:150px;">
							<option value="">--请选择--</option> 
							<?php foreach($agentinfo AS $v):?>
							<option value="<?=$v['admin_id']?>"><?=$v['username']?>|<?=$v['phone']?></option> 
							<?php endforeach;?>
						</select> 
						</div>
					</li> 
					<li onclick="$('#listform').submit();"><span><img src="/zhenze/Public/admin/images/t02.png" /></span>分配代理</li> 
				</ul> 
            </form>
        </div>
        <script type="text/javascript">
            $('.tablelist tbody tr:odd').addClass('odd');
            $(function () {
                $("#chkAll").click(function () {
                    var flag = $("#chkAll").prop("checked");
                    $("[id^='checkbox']").each(function () {
                        $(this).prop("checked", flag);
                    });
                });

                var isd = '';
                //如果全部项都勾上了，则全部选项也被选上， 选项中有一项取消了，则全选框也会自动取消。
                $("[id^='checkbox']").each(function () {
                    $(this).click(function () {
                        if ($("[id^='checkbox']:checked").length == $("[id^='checkbox']").length) {
                            $("#chkAll").prop("checked", "checked");
                        } else {
                            $('#chkAll').removeAttr("checked");
                        }
                    });
                });
            })
        </script>
    </body>

</html>